package cn.javass.dp.signleton.example1;

/**
 * 静态内部类
 */
public class Signleton3 {
    private Signleton3() { }
    private  static  class SignletonInstance {
        private static final Signleton3 INSTANCE = new Signleton3();
    }

    public static Signleton3 getInstance () {
        return SignletonInstance.INSTANCE;
    }

    public static void main(String[] args) {
        System.out.println(Signleton3.getInstance().hashCode());
        System.out.println(Signleton3.getInstance().hashCode());
        System.out.println(Signleton3.getInstance().hashCode());
    }
}
